﻿@model mtm.Votes.Models.VotesModel
@{ 
    /* Copyright © 2009 - 2010 Oleg Stuhin & Rostislav Haitovich 
       To learn more about mytrip.mvc visit  
       http://mytripmvc.net  http://mytripmvc.codeplex.com 
       mytripmvc@gmail.com
       license: Microsoft Public License (Ms-PL) */ 
}
@{
    ViewBag.Title = Html.MytripPageTitle(VotesLanguage.votes_manager, "/");
    ViewBag.Keywords=Html.MytripPageTitle(VotesLanguage.votes_manager, ",");
    ViewBag.Description=Html.MytripPageTitle(VotesLanguage.votes_manager, ",");
}
@section scriptlink{
@Html.ScriptLink("jquery.validate.min.js,jquery.validate.unobtrusive.min.js,mtm.Delete.js,ui.datepicker.js,Page/Votes.js")
@if (mtm.Core.Settings.LocalisationSetting.culture() == "ru-ru")
{
@Html.ScriptLink("ui.datepicker-ru.js")
}
}
@section content{
 <h1 class="title">
@VotesLanguage.votes_manager</h1>
<div class="content">
@Html.VotesList()
</div>
<h1 class="title">@VotesLanguage.add_new_vote</h1>
@using (Html.BeginForm()){
<fieldset>
<div class="editor-label">
@Html.LabelFor(model => model.Question, VotesLanguage.question_max_lenght)
</div><div class="editor-field">
@Html.TextAreaFor(x=>x.Question,new {@class="message", style = "width: 350px;height:50px"})
@Html.ValidationMessage("Question")
</div><div class="editor-label">
@Html.LabelFor(model => model.Count, VotesLanguage.choose_number_of_answers)
@Html.DropDownListFor(model => model.Count, Model.QtAnswers)
</div>
@{int ctr = 0;}
@foreach (var answer in Model.Answers){
<div class="editor-label">
@Html.LabelFor("Answers_"+ctr+"_", VotesLanguage.answer+" "+ (ctr+1))
</div><div class="editor-field">   
@Html.TextBoxFor(x=>x.Answers[ctr],new { style = "width: 350px;"})
@Html.ValidationMessage("Answers_"+ctr+"_")
</div>
ctr++;
} 
<div class="editor-label">
@Html.CheckBoxFor(model => model.AllCulture)

@Html.LabelFor(model => model.AllCulture, VotesLanguage.display_in_all_languages)
</div><div class="editor-label">
@Html.CheckBoxFor(model => model.OnlyForRegisterUser)
@Html.LabelFor(model => model.OnlyForRegisterUser, VotesLanguage.only_for_registered_users)
</div><div class="editor-label">
@Html.CheckBoxFor(model => model.Active)
@Html.LabelFor(model => model.Active, VotesLanguage.make_active)
</div><div class="editor-label">
@Html.LabelFor(model => model.CloseDate, VotesLanguage.close_date)
</div><div class="editor-field"> 
@Html.TextBoxFor(model => model.CloseDate)
@Html.ValidationMessageFor(model => model.CloseDate)
</div>
<div class="button">
@Html.MytripButton(VotesLanguage.add_new_vote,true,"left")
@Html.MytripButton("/Core/ControlPanel", CoreLanguage.cancel, false,"left") 
</div>
</fieldset>
}
<div id="delete" class="window"> 
<div class="modalTC">@CoreLanguage.delete</div>
<div class="modalC">
<table class="leftmidle"><tr><td>
@Html.MytripImage("/images/warning.png","warning","i")
</td><td>
<h3 class="hometitle">@CoreLanguage.are_you_sure</h3>
</td></tr></table>  
<div class="button">
@Html.MytripButton(CoreLanguage.cancel, false, "close","right")
@Html.MytripButton(CoreLanguage.remove, true, "enter","right")      
</div>
</div> 
</div>
}

